import java.sql.SQLOutput;
import java.util.Random;
import java.util.Scanner;

public class Test {
    public static void main(String[] args) {
        int ret = fib(7);
        System.out.println(ret);
    }

    public static int fib(int n) {
        if(n == 1 || n == 2){
            return 1;
        }
        int r1 = 1,r2 = 1,r3 = 0;
        for (int i = 3; i <= n; i++) {
            r3 = r1 + r2;
            r1 = r2;
            r2 = r3;
        }
        return r3;
    }
    public static int Compare2(int a, int b){
       int ret2 = a > b ? a : b;
       return ret2;
   }

   public static int Compare3(int a,int b,int c){
       int ret3 = Compare2(a,b) > c ? Compare2(a,b) : c;
       return ret3;
   }

    public static void main9(String[] args) {
        int ret = Compare3(34,56,36);
        System.out.println(ret);

    }

    public static void main8(String[] args) {
            Scanner scanner = new Scanner(System.in);
            System.out.print("请输入一个整数：");
            int num = scanner.nextInt();

            System.out.println("输入的整数的每一位是：");
            while (num != 0) {
                int digit = num % 10; // 获取最后一位数字
                System.out.println(digit);
                num /= 10; // 去掉最后一位数字
            }

            scanner.close();
        }

    public static void main7(String[] args) {
        String Right_PassWord = "kj6666";
        int num = 3;
        Scanner scanf = new Scanner(System.in);

        while(num != 0){
            System.out.println("请输入密码：");
            String input_PassWord = scanf.nextLine();

            if(input_PassWord.equals(Right_PassWord)){
                System.out.println("登陆成功！");
                break;
            }else{
                num--;
                if(num == 0){
                    System.out.println("密码错误三次，登陆失败！");
                }else{
                    System.out.println("密码错误!");
                }
            }
        }
        scanf.close();
    }

    public static void main6(String[] args) {
        double sum = 0;
        for (int i = 1; i <= 100; i++) {
            if(i % 2 == 0){
                sum -= 1.0 / i;
            }else{
                sum += 1.0 / i;
            }
        }
        System.out.println(sum);
    }

    public static void main5(String[] args) {
        Scanner scanf = new Scanner(System.in);
        Random random = new Random();

        int guessNum = random.nextInt(100);//0-99
        while(true){
            System.out.println("请输入你猜测的数字：");
            int num = scanf.nextInt();
            if(num < guessNum){
                System.out.println("猜小了");
            }else if(num > guessNum){
                System.out.println("猜大了");
            }else{
                System.out.println("猜对了");
                break;
            }
        }
        scanf.close();
    }

    public static void main4(String[] args) {
        int sum = 0;
        for (int i = 1; i <=100 ; i++) {
            if(i % 10 == 9 ) {
                sum++;
            }
            if(i / 10 == 9){
                sum++;
            }
        }
        System.out.println(sum);
    }

    public static void main3(String[] args) {
        Scanner scan = new Scanner(System.in);

        System.out.println("请输入两位整数a和b：");
        int a = scan.nextInt();
        int b = scan.nextInt();

        int c = a % b;
        while(c != 0){
            a = b;
            b = c;
            c =a % b;
        }
        System.out.println(b);
    }



    public static void main2(String[] args) {
        int i = 1;
        while(i <= 100){
            if(i%3 == 0 && i%5 == 0){
                System.out.println(i);
                i++;
            }
            else{
                i++;
                continue;
            }
        }
    }

    public static void main1(String[] args) {
        int a = 1;
        int osum = 0,jsum = 0;
        for( a = 1;a <= 100;a++){
            if(a%2 == 0){
                osum += a;
            }
            else{
                jsum += a;
            }
        }
        System.out.println(osum);
        System.out.println(jsum);
    }
}
